#ifndef CViewController_h__
#define CViewController_h__

#include "Header.h"
#include "CVSView.h"

namespace GameTutor
{
	template <class T>
	class CViewController
	{
	public:
		static CViewController* GetInstance() {return s_pInstace;}
		static void CreateView(int w, int h, bool fullscreen = false, const char* name = 0)
		{
			if (!s_pInstace)
			{
				s_pInstace = new CViewController();

				s_pInstace->m_pView = new T(w, h, fullscreen, name);
			}
		}

		T* GetView() {return m_pView;};

		virtual ~CViewController()
		{
			if (m_pView) delete m_pView;
		}
	protected:
		CViewController() : m_pView(0) {}
		static CViewController* s_pInstace;
		T* m_pView;
	};
}
#endif // CViewController_h__
